<div class="container">
    <div class="panel dux-box">
        <div class="panel-head">{$name}边栏</div>
        <form method="post" class="form-x" action="{url()}">
            <div class="panel-body">
                <div class="form-group">
                    <div class="label">边栏标题</div>
                    <div class="field">
                        <input type="text" class="input" id="name" name="name" size="60" data-validate="required:必填" placeholder="请输入边栏名称" value="{$info.name}">
                    </div>
                </div>
                <div class="form-group">
                    <div class="label">边栏顺序</div>
                    <div class="field">
                        <input type="number" class="input" id="sequence" name="sequence" data-validate="required:必填" value="{default_data($info['sequence'],1)}">

                    </div>
                </div>
                <div class="form-group">
                    <div class="label">边栏内容</div>
                    <div class="field">
                        <div class="tab">
                            <div class="tab-head">
                                <ul class="tab-nav" id="tab">
                                    <li <!--if{!$info['type']}-->class="active" <!--{/if}-->><a href="#tab-diy" data="0">自定义</a>
                                    </li>
                                    <li <!--if{$info['type']}-->class="active" <!--{/if}-->><a href="#tab-model" data="1">系统模块</a>
                                    </li>
                                </ul>
                            </div>
                            <div class="tab-body">
                                <div class="tab-panel  <!--if{!$info['type']}--> active <!--{/if}-->" id="tab-diy">
                                    <textarea id="diy" name="diy" class="input" placeholder="请填写内容" rows="15"><!--if{!$info['type']}-->{$info.content}<!--{/if}--></textarea>
                                </div>
                                <div class="tab-panel <!--if{$info['type']}-->active <!--{/if}-->" id="tab-model">
                                    <select class="input" name="model">
                                        <!--loop{$modelList as $key => $vo}-->
                                        <!--if{$info['content'] == $key}-->
                                        <option value="{$key}" selected>
                                            <!--{else}-->
                                            <option value="{$key}">
                                                <!--{/if}-->
                                                {$vo.name}</option>
                                            <!--{/loop}-->
                                    </select>
                                    <div class="input-note">可以选择系统中的模块</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel-foot">
                <div class="form-button">
                    <div id="tips"></div>
                    <input type="hidden" id="type" name="type" type="hidden" value="{$info.type}">
                    <input type="hidden" name="sidebar_id" type="hidden" value="{$info.sidebar_id}">
                    <button class="button bg-main" type="submit">保存</button>
                    <button class="button bg" type="reset">重置</button>
                </div>
            </div>
        </form>
    </div>
    <br>
</div>
<script>
    Do.ready('base', function () {
        //编辑器
        $('#diy').bbsEditor();
        //选择
        $('#tab a').click(function(){
            $('#type').val($(this).attr('data'));
        });
    });
</script>